Telegram Group & Telegram Channel
Все объекты, которые в настоящий момент существуют в памяти интерпретатора, можно получить с помощью gc.get_objects():


In [1]: class A:
...: def __init__(self, x):
...: self._x = x
...:
...: def __repr__(self):
...: class_name = type(self).__name__
...: x = self._x
...: return f'{class_name}({x!r})'
...:

In [2]: A(1)
Out[2]: A(1)

In [3]: A(2)
Out[3]: A(2)

In [4]: A(3)
Out[4]: A(3)

In [5]: [x for x in gc.get_objects() if isinstance(x, A)]
Out[5]: [A(1), A(2), A(3)]


👉@BookPython



tg-me.com/BookPython/3699
Create:
Last Update:

Все объекты, которые в настоящий момент существуют в памяти интерпретатора, можно получить с помощью gc.get_objects():


In [1]: class A:
...: def __init__(self, x):
...: self._x = x
...:
...: def __repr__(self):
...: class_name = type(self).__name__
...: x = self._x
...: return f'{class_name}({x!r})'
...:

In [2]: A(1)
Out[2]: A(1)

In [3]: A(2)
Out[3]: A(2)

In [4]: A(3)
Out[4]: A(3)

In [5]: [x for x in gc.get_objects() if isinstance(x, A)]
Out[5]: [A(1), A(2), A(3)]


👉@BookPython

BY Библиотека Python разработчика | Книги по питону


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/BookPython/3699

View MORE
Open in Telegram


Библиотека Python разработчика Telegram | DID YOU KNOW?

Date: |

In many cases, the content resembled that of the marketplaces found on the dark web, a group of hidden websites that are popular among hackers and accessed using specific anonymising software.“We have recently been witnessing a 100 per cent-plus rise in Telegram usage by cybercriminals,” said Tal Samra, cyber threat analyst at Cyberint.The rise in nefarious activity comes as users flocked to the encrypted chat app earlier this year after changes to the privacy policy of Facebook-owned rival WhatsApp prompted many to seek out alternatives.

Библиотека Python разработчика from it


Telegram Библиотека Python разработчика | Книги по питону
FROM USA